﻿@using Microsoft.AspNetCore.Authorization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using JS.Abp.DataPermission.Permissions
@using JS.Abp.DataPermission.Web.Pages.DataPermission.PermissionItems
@using JS.Abp.DataPermission.Web.Menus
@using Microsoft.AspNetCore.Mvc.Localization
@using JS.Abp.DataPermission.Localization
@inject IHtmlLocalizer<DataPermissionResource> L
@inject IAuthorizationService Authorization
@model JS.Abp.DataPermission.Web.Pages.DataPermission.Components.PermissionItems.PermissionItemsViewModel



<abp-card>
	<abp-card-body>
		<abp-input type="hidden" asp-for="@Model.ObjectNameFilter" label="@L["ObjectName"].Value"/>


		<abp-table striped-rows="true" id="PermissionItemsTable" >
			<thead>
			<tr>
				<abp-row class="mb-3">
					<abp-column size="_9">
						<form id="SearchFormItem" autocomplete="off">
							<div class="input-group">
								<input class="form-control page-search-filter-text" id="FilterItemText" placeholder="@L["Search"]"/>
								<abp-button button-type="Primary" type="submit" icon="search"/>
							</div>
						</form>


					</abp-column>
					<abp-column Class="justify-content-end" Style="text-align: right" size="_3">
						@if (await Authorization.IsGrantedAsync(DataPermissionPermissions.PermissionItems.Create))
						{
							<abp-button id="NewPermissionItemButton" text="@L["NewPermissionItem"].Value" icon="plus" button-type="Primary"/>
						}
					</abp-column>
				</abp-row>


			</tr>
			<tr>
				<th>@L["Actions"]</th>
				@* <th>@L["ObjectName"]</th> *@
				<th>@L["RoleName"]</th>
				<th>@L["TargetType"]</th>

				<th>@L["CanRead"]</th>
				<th>@L["CanCreate"]</th>
				<th>@L["CanEdit"]</th>
				<th>@L["CanDelete"]</th>
				<th>@L["IsActive"]</th>
				<th>@L["Description"]</th>

			</tr>
			</thead>
		</abp-table>
		
	</abp-card-body>
</abp-card>